﻿using System;
using System.Collections.Generic;
using System.Security.Permissions;
using App.Interface;
using Domain.Entidades;
using Domain.Interfaces.Servicos;

namespace App
{
    public class AvisoAppService : AppServiceBase<aviso>, IAvisoAppService
    {
        private readonly IAvisoService _avisoAppService;

        public AvisoAppService(IAvisoService avisoAppService) : base(avisoAppService)

        {
            _avisoAppService = avisoAppService;
        }

        public IEnumerable<VW_avisos> Listar(DateTime dt1, DateTime dt2, VW_usuarios usuario)
        {
            return _avisoAppService.Listar(dt1, dt2, usuario);

        }

        public void Inserir(aviso aviso)
        {
            try
            {
               _avisoAppService.Inserir(aviso);
            }
            catch (Exception ex)
            {
                
                throw ex;
            }

        }

        public VW_avisos carrega_aviso(int codigo)
        {

            try
            {
                return _avisoAppService.carrega_aviso(codigo);
            }
            catch (Exception ex)
            {
                
                throw ex;
            }

        }

       public void deletar(aviso aviso)
        {
            try
            {
                _avisoAppService.deletar(aviso);

            }
            catch (Exception ex)
            {
                
                throw ex;
            }


        }

        public aviso GetId(int codigo)
        {
            try
            {
               return _avisoAppService.GetId(codigo);

            }
            catch (Exception ex)
            {
                

                throw ex;
            }

        }


    }
}
